<template>
	<!-- 20221228 -->
	<view class="text-switch-cn">

		<!-- 组件内容 -->
		<view class="cn-content">
			<view class="radius-25 flex align-center" :class="isOn ? 'bg-main justify-end' : 'bg-ed justify-start'"
				style="width: 100rpx; height: 50rpx;" @click="switchTab">
				<view class="radius-50p bg-ff" style="margin:0 1rpx; width: 48rpx; height: 48rpx;"></view>
			</view>
		</view>

		<!-- 组件浮层 -->
		<view class="cn-layer">

		</view>
	</view>
</template>

<script>
	export default {
		props: {
			// 开关是否打开
			isOn: {
				type: Boolean,
				default: true
			}
		},
		methods: {

			/**
			 * 切换开关
			 * @param {Object} e
			 * @date 2022-12-28
			 */
			switchTab(e) {
				this.$emit('switchTab', {
					curStatus: this.isOn
				})
			}
		}
	}
</script>

<style scoped>

</style>
